package ch8.PC;

public class Computer {
    CPU cpu;
    Memory memory;
    HardDisk hardDisk;
    USB usb;

    public Computer(CPU cpu, Memory memory, HardDisk hardDisk) {
        this.cpu = cpu;
        this.memory = memory;
        this.hardDisk = hardDisk;
    }


    public void show(USB um,USB uk) {
        System.out.println("计算机的信息如下：\n" +
                        "cpu的品牌是：" + cpu.getCPUBrand() + ",主频是：" + cpu.getFrequency() + "GHz。\n" +
                        "硬盘的品牌是：" + memory.getMemoryBrand() + ",容量是：" +
                        memory.getMemoryCapacity() + "GB。" +
                        "\n内存条的品牌是：" + hardDisk.getHardDiskBrand() +
                        ",容量是：" + hardDisk.getHardDiskCapacity() + "GB。");
        um.interposition();
        um.work();
        um.insert();
        uk.interposition();
        uk.work();
        uk.insert();
//        "计算机的信息如下：\n" +
//                "cpu的品牌是：" + cpu.getCPUBrand() + ",主频是：" + cpu.getFrequency() + "GHz。\n" +
//                "硬盘的品牌是：" + memory.getMemoryBrand() + ",容量是：" +
//                memory.getMemoryCapacity() + "GB。" +
//                "\n内存条的品牌是：" + hardDisk.getHardDiskBrand() +
//                ",容量是：" + hardDisk.getHardDiskCapacity() + "GB。";

    }

    public CPU getCpu() {
        return cpu;
    }

    public void setCpu(CPU cpu) {
        this.cpu = cpu;
    }

    public Memory getMemory() {
        return memory;
    }

    public void setMemory(Memory memory) {
        this.memory = memory;
    }

    public HardDisk getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(HardDisk hardDisk) {
        this.hardDisk = hardDisk;
    }

    public USB getUsb() {
        return usb;
    }

    public void setUsb(USB usb) {
        this.usb = usb;
    }
}
